//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2021 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto/tree/main/CodeGenerator. DO NOT EDIT.

import Foundation
import SotoCore

extension RedshiftDataAPIService {
    // MARK: Enums

    public enum StatusString: String, CustomStringConvertible, Codable {
        case aborted = "ABORTED"
        case all = "ALL"
        case failed = "FAILED"
        case finished = "FINISHED"
        case picked = "PICKED"
        case started = "STARTED"
        case submitted = "SUBMITTED"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct CancelStatementRequest: AWSEncodableShape {
        /// The identifier of the SQL statement to cancel. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. This identifier is returned by ExecuteStatment and ListStatements.
        public let id: String

        public init(id: String) {
            self.id = id
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
        }
    }

    public struct CancelStatementResponse: AWSDecodableShape {
        /// A value that indicates whether the cancel statement succeeded (true).
        public let status: Bool?

        public init(status: Bool? = nil) {
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case status = "Status"
        }
    }

    public struct ColumnMetadata: AWSDecodableShape {
        /// The default value of the column.
        public let columnDefault: String?
        /// A value that indicates whether the column is case-sensitive.
        public let isCaseSensitive: Bool?
        /// A value that indicates whether the column contains currency values.
        public let isCurrency: Bool?
        /// A value that indicates whether an integer column is signed.
        public let isSigned: Bool?
        /// The label for the column.
        public let label: String?
        /// The length of the column.
        public let length: Int?
        /// The name of the column.
        public let name: String?
        /// A value that indicates whether the column is nullable.
        public let nullable: Int?
        /// The precision value of a decimal number column.
        public let precision: Int?
        /// The scale value of a decimal number column.
        public let scale: Int?
        /// The name of the schema that contains the table that includes the column.
        public let schemaName: String?
        /// The name of the table that includes the column.
        public let tableName: String?
        /// The database-specific data type of the column.
        public let typeName: String?

        public init(columnDefault: String? = nil, isCaseSensitive: Bool? = nil, isCurrency: Bool? = nil, isSigned: Bool? = nil, label: String? = nil, length: Int? = nil, name: String? = nil, nullable: Int? = nil, precision: Int? = nil, scale: Int? = nil, schemaName: String? = nil, tableName: String? = nil, typeName: String? = nil) {
            self.columnDefault = columnDefault
            self.isCaseSensitive = isCaseSensitive
            self.isCurrency = isCurrency
            self.isSigned = isSigned
            self.label = label
            self.length = length
            self.name = name
            self.nullable = nullable
            self.precision = precision
            self.scale = scale
            self.schemaName = schemaName
            self.tableName = tableName
            self.typeName = typeName
        }

        private enum CodingKeys: String, CodingKey {
            case columnDefault
            case isCaseSensitive
            case isCurrency
            case isSigned
            case label
            case length
            case name
            case nullable
            case precision
            case scale
            case schemaName
            case tableName
            case typeName
        }
    }

    public struct DescribeStatementRequest: AWSEncodableShape {
        /// The identifier of the SQL statement to describe. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. This identifier is returned by ExecuteStatment and ListStatements.
        public let id: String

        public init(id: String) {
            self.id = id
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
        }
    }

    public struct DescribeStatementResponse: AWSDecodableShape {
        /// The cluster identifier.
        public let clusterIdentifier: String?
        /// The date and time (UTC) when the SQL statement was submitted to run.
        public let createdAt: Date?
        /// The name of the database.
        public let database: String?
        /// The database user name.
        public let dbUser: String?
        /// The amount of time in nanoseconds that the statement ran.
        public let duration: Int64?
        /// The error message from the cluster if the SQL statement encountered an error while running.
        public let error: String?
        /// A value that indicates whether the statement has a result set. The result set can be empty.
        public let hasResultSet: Bool?
        /// The identifier of the SQL statement described. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.
        public let id: String
        /// The SQL statement text.
        public let queryString: String?
        /// The process identifier from Amazon Redshift.
        public let redshiftPid: Int64?
        /// The identifier of the query generated by Amazon Redshift. These identifiers are also available in the query column of the STL_QUERY system view.
        public let redshiftQueryId: Int64?
        /// Either the number of rows returned from the SQL statement or the number of rows affected. If result size is greater than zero, the result rows can be the number of rows affected by SQL statements such as INSERT, UPDATE, DELETE, COPY, and others.
        public let resultRows: Int64?
        /// The size in bytes of the returned results.
        public let resultSize: Int64?
        /// The name or Amazon Resource Name (ARN) of the secret that enables access to the database.
        public let secretArn: String?
        /// The status of the SQL statement being described. Status values are defined as follows:    ABORTED - The query run was stopped by the user.    ALL - A status value that includes all query statuses. This value can be used to filter results.    FAILED - The query run failed.    FINISHED - The query has finished running.    PICKED - The query has been chosen to be run.    STARTED - The query run has started.    SUBMITTED - The query was submitted, but not yet processed.
        public let status: StatusString?
        /// The date and time (UTC) that the metadata for the SQL statement was last updated. An example is the time the status last changed.
        public let updatedAt: Date?

        public init(clusterIdentifier: String? = nil, createdAt: Date? = nil, database: String? = nil, dbUser: String? = nil, duration: Int64? = nil, error: String? = nil, hasResultSet: Bool? = nil, id: String, queryString: String? = nil, redshiftPid: Int64? = nil, redshiftQueryId: Int64? = nil, resultRows: Int64? = nil, resultSize: Int64? = nil, secretArn: String? = nil, status: StatusString? = nil, updatedAt: Date? = nil) {
            self.clusterIdentifier = clusterIdentifier
            self.createdAt = createdAt
            self.database = database
            self.dbUser = dbUser
            self.duration = duration
            self.error = error
            self.hasResultSet = hasResultSet
            self.id = id
            self.queryString = queryString
            self.redshiftPid = redshiftPid
            self.redshiftQueryId = redshiftQueryId
            self.resultRows = resultRows
            self.resultSize = resultSize
            self.secretArn = secretArn
            self.status = status
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case clusterIdentifier = "ClusterIdentifier"
            case createdAt = "CreatedAt"
            case database = "Database"
            case dbUser = "DbUser"
            case duration = "Duration"
            case error = "Error"
            case hasResultSet = "HasResultSet"
            case id = "Id"
            case queryString = "QueryString"
            case redshiftPid = "RedshiftPid"
            case redshiftQueryId = "RedshiftQueryId"
            case resultRows = "ResultRows"
            case resultSize = "ResultSize"
            case secretArn = "SecretArn"
            case status = "Status"
            case updatedAt = "UpdatedAt"
        }
    }

    public struct DescribeTableRequest: AWSEncodableShape {
        /// The cluster identifier. This parameter is required when authenticating using either AWS Secrets Manager or temporary credentials.
        public let clusterIdentifier: String
        /// A database name. The connected database is specified when you connect with your authentication credentials.
        public let connectedDatabase: String?
        /// The name of the database that contains the tables to be described. If ConnectedDatabase is not specified, this is also the database to connect to with your authentication credentials.
        public let database: String
        /// The database user name. This parameter is required when authenticating using temporary credentials.
        public let dbUser: String?
        /// The maximum number of tables to return in the response. If more tables exist than fit in one response, then NextToken is returned to page through the results.
        public let maxResults: Int?
        /// A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
        public let nextToken: String?
        /// The schema that contains the table. If no schema is specified, then matching tables for all schemas are returned.
        public let schema: String?
        /// The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using AWS Secrets Manager.
        public let secretArn: String?
        /// The table name. If no table is specified, then all tables for all matching schemas are returned. If no table and no schema is specified, then all tables for all schemas in the database are returned
        public let table: String?

        public init(clusterIdentifier: String, connectedDatabase: String? = nil, database: String, dbUser: String? = nil, maxResults: Int? = nil, nextToken: String? = nil, schema: String? = nil, secretArn: String? = nil, table: String? = nil) {
            self.clusterIdentifier = clusterIdentifier
            self.connectedDatabase = connectedDatabase
            self.database = database
            self.dbUser = dbUser
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.schema = schema
            self.secretArn = secretArn
            self.table = table
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case clusterIdentifier = "ClusterIdentifier"
            case connectedDatabase = "ConnectedDatabase"
            case database = "Database"
            case dbUser = "DbUser"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case schema = "Schema"
            case secretArn = "SecretArn"
            case table = "Table"
        }
    }

    public struct DescribeTableResponse: AWSDecodableShape {
        /// A list of columns in the table.
        public let columnList: [ColumnMetadata]?
        /// A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
        public let nextToken: String?
        /// The table name.
        public let tableName: String?

        public init(columnList: [ColumnMetadata]? = nil, nextToken: String? = nil, tableName: String? = nil) {
            self.columnList = columnList
            self.nextToken = nextToken
            self.tableName = tableName
        }

        private enum CodingKeys: String, CodingKey {
            case columnList = "ColumnList"
            case nextToken = "NextToken"
            case tableName = "TableName"
        }
    }

    public struct ExecuteStatementInput: AWSEncodableShape {
        /// The cluster identifier. This parameter is required when authenticating using either AWS Secrets Manager or temporary credentials.
        public let clusterIdentifier: String
        /// The name of the database. This parameter is required when authenticating using temporary credentials.
        public let database: String?
        /// The database user name. This parameter is required when authenticating using temporary credentials.
        public let dbUser: String?
        /// The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using AWS Secrets Manager.
        public let secretArn: String?
        /// The SQL statement text to run.
        public let sql: String
        /// The name of the SQL statement. You can name the SQL statement when you create it to identify the query.
        public let statementName: String?
        /// A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.
        public let withEvent: Bool?

        public init(clusterIdentifier: String, database: String? = nil, dbUser: String? = nil, secretArn: String? = nil, sql: String, statementName: String? = nil, withEvent: Bool? = nil) {
            self.clusterIdentifier = clusterIdentifier
            self.database = database
            self.dbUser = dbUser
            self.secretArn = secretArn
            self.sql = sql
            self.statementName = statementName
            self.withEvent = withEvent
        }

        public func validate(name: String) throws {
            try self.validate(self.statementName, name: "statementName", parent: name, max: 500)
            try self.validate(self.statementName, name: "statementName", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case clusterIdentifier = "ClusterIdentifier"
            case database = "Database"
            case dbUser = "DbUser"
            case secretArn = "SecretArn"
            case sql = "Sql"
            case statementName = "StatementName"
            case withEvent = "WithEvent"
        }
    }

    public struct ExecuteStatementOutput: AWSDecodableShape {
        /// The cluster identifier.
        public let clusterIdentifier: String?
        /// The date and time (UTC) the statement was created.
        public let createdAt: Date?
        /// The name of the database.
        public let database: String?
        /// The database user name.
        public let dbUser: String?
        /// The identifier of the statement to be run. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.
        public let id: String?
        /// The name or ARN of the secret that enables access to the database.
        public let secretArn: String?

        public init(clusterIdentifier: String? = nil, createdAt: Date? = nil, database: String? = nil, dbUser: String? = nil, id: String? = nil, secretArn: String? = nil) {
            self.clusterIdentifier = clusterIdentifier
            self.createdAt = createdAt
            self.database = database
            self.dbUser = dbUser
            self.id = id
            self.secretArn = secretArn
        }

        private enum CodingKeys: String, CodingKey {
            case clusterIdentifier = "ClusterIdentifier"
            case createdAt = "CreatedAt"
            case database = "Database"
            case dbUser = "DbUser"
            case id = "Id"
            case secretArn = "SecretArn"
        }
    }

    public struct Field: AWSDecodableShape {
        /// A value of the BLOB data type.
        public let blobValue: Data?
        /// A value of the Boolean data type.
        public let booleanValue: Bool?
        /// A value of the double data type.
        public let doubleValue: Double?
        /// A value that indicates whether the data is NULL.
        public let isNull: Bool?
        /// A value of the long data type.
        public let longValue: Int64?
        /// A value of the string data type.
        public let stringValue: String?

        public init(blobValue: Data? = nil, booleanValue: Bool? = nil, doubleValue: Double? = nil, isNull: Bool? = nil, longValue: Int64? = nil, stringValue: String? = nil) {
            self.blobValue = blobValue
            self.booleanValue = booleanValue
            self.doubleValue = doubleValue
            self.isNull = isNull
            self.longValue = longValue
            self.stringValue = stringValue
        }

        private enum CodingKeys: String, CodingKey {
            case blobValue
            case booleanValue
            case doubleValue
            case isNull
            case longValue
            case stringValue
        }
    }

    public struct GetStatementResultRequest: AWSEncodableShape {
        /// The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. This identifier is returned by ExecuteStatment and ListStatements.
        public let id: String
        /// A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
        public let nextToken: String?

        public init(id: String, nextToken: String? = nil) {
            self.id = id
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case nextToken = "NextToken"
        }
    }

    public struct GetStatementResultResponse: AWSDecodableShape {
        /// The properties (metadata) of a column.
        public let columnMetadata: [ColumnMetadata]?
        /// A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
        public let nextToken: String?
        /// The results of the SQL statement.
        public let records: [[Field]]
        /// The total number of rows in the result set returned from a query. You can use this number to estimate the number of calls to the GetStatementResult operation needed to page through the results.
        public let totalNumRows: Int64?

        public init(columnMetadata: [ColumnMetadata]? = nil, nextToken: String? = nil, records: [[Field]], totalNumRows: Int64? = nil) {
            self.columnMetadata = columnMetadata
            self.nextToken = nextToken
            self.records = records
            self.totalNumRows = totalNumRows
        }

        private enum CodingKeys: String, CodingKey {
            case columnMetadata = "ColumnMetadata"
            case nextToken = "NextToken"
            case records = "Records"
            case totalNumRows = "TotalNumRows"
        }
    }

    public struct ListDatabasesRequest: AWSEncodableShape {
        /// The cluster identifier. This parameter is required when authenticating using either AWS Secrets Manager or temporary credentials.
        public let clusterIdentifier: String
        /// The name of the database. This parameter is required when authenticating using temporary credentials.
        public let database: String?
        /// The database user name. This parameter is required when authenticating using temporary credentials.
        public let dbUser: String?
        /// The maximum number of databases to return in the response. If more databases exist than fit in one response, then NextToken is returned to page through the results.
        public let maxResults: Int?
        /// A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
        public let nextToken: String?
        /// The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using AWS Secrets Manager.
        public let secretArn: String?

        public init(clusterIdentifier: String, database: String? = nil, dbUser: String? = nil, maxResults: Int? = nil, nextToken: String? = nil, secretArn: String? = nil) {
            self.clusterIdentifier = clusterIdentifier
            self.database = database
            self.dbUser = dbUser
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.secretArn = secretArn
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case clusterIdentifier = "ClusterIdentifier"
            case database = "Database"
            case dbUser = "DbUser"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case secretArn = "SecretArn"
        }
    }

    public struct ListDatabasesResponse: AWSDecodableShape {
        /// The names of databases.
        public let databases: [String]?
        /// A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
        public let nextToken: String?

        public init(databases: [String]? = nil, nextToken: String? = nil) {
            self.databases = databases
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case databases = "Databases"
            case nextToken = "NextToken"
        }
    }

    public struct ListSchemasRequest: AWSEncodableShape {
        /// The cluster identifier. This parameter is required when authenticating using either AWS Secrets Manager or temporary credentials.
        public let clusterIdentifier: String
        /// A database name. The connected database is specified when you connect with your authentication credentials.
        public let connectedDatabase: String?
        /// The name of the database that contains the schemas to list. If ConnectedDatabase is not specified, this is also the database to connect to with your authentication credentials.
        public let database: String
        /// The database user name. This parameter is required when authenticating using temporary credentials.
        public let dbUser: String?
        /// The maximum number of schemas to return in the response. If more schemas exist than fit in one response, then NextToken is returned to page through the results.
        public let maxResults: Int?
        /// A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
        public let nextToken: String?
        /// A pattern to filter results by schema name. Within a schema pattern, "%" means match any substring of 0 or more characters and "_" means match any one character. Only schema name entries matching the search pattern are returned.
        public let schemaPattern: String?
        /// The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using AWS Secrets Manager.
        public let secretArn: String?

        public init(clusterIdentifier: String, connectedDatabase: String? = nil, database: String, dbUser: String? = nil, maxResults: Int? = nil, nextToken: String? = nil, schemaPattern: String? = nil, secretArn: String? = nil) {
            self.clusterIdentifier = clusterIdentifier
            self.connectedDatabase = connectedDatabase
            self.database = database
            self.dbUser = dbUser
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.schemaPattern = schemaPattern
            self.secretArn = secretArn
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case clusterIdentifier = "ClusterIdentifier"
            case connectedDatabase = "ConnectedDatabase"
            case database = "Database"
            case dbUser = "DbUser"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case schemaPattern = "SchemaPattern"
            case secretArn = "SecretArn"
        }
    }

    public struct ListSchemasResponse: AWSDecodableShape {
        /// A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
        public let nextToken: String?
        /// The schemas that match the request pattern.
        public let schemas: [String]?

        public init(nextToken: String? = nil, schemas: [String]? = nil) {
            self.nextToken = nextToken
            self.schemas = schemas
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case schemas = "Schemas"
        }
    }

    public struct ListStatementsRequest: AWSEncodableShape {
        /// The maximum number of SQL statements to return in the response. If more SQL statements exist than fit in one response, then NextToken is returned to page through the results.
        public let maxResults: Int?
        /// A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
        public let nextToken: String?
        /// A value that filters which statements to return in the response. If true, all statements run by the caller's IAM role are returned. If false, only statements run by the caller's IAM role in the current IAM session are returned. The default is true.
        public let roleLevel: Bool?
        /// The name of the SQL statement specified as input to ExecuteStatement to identify the query. You can list multiple statements by providing a prefix that matches the beginning of the statement name. For example, to list myStatement1, myStatement2, myStatement3, and so on, then provide the a value of myStatement. Data API does a case-sensitive match of SQL statement names to the prefix value you provide.
        public let statementName: String?
        /// The status of the SQL statement to list. Status values are defined as follows:    ABORTED - The query run was stopped by the user.    ALL - A status value that includes all query statuses. This value can be used to filter results.    FAILED - The query run failed.    FINISHED - The query has finished running.    PICKED - The query has been chosen to be run.    STARTED - The query run has started.    SUBMITTED - The query was submitted, but not yet processed.
        public let status: StatusString?

        public init(maxResults: Int? = nil, nextToken: String? = nil, roleLevel: Bool? = nil, statementName: String? = nil, status: StatusString? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.roleLevel = roleLevel
            self.statementName = statementName
            self.status = status
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
            try self.validate(self.statementName, name: "statementName", parent: name, max: 500)
            try self.validate(self.statementName, name: "statementName", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case roleLevel = "RoleLevel"
            case statementName = "StatementName"
            case status = "Status"
        }
    }

    public struct ListStatementsResponse: AWSDecodableShape {
        /// A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
        public let nextToken: String?
        /// The SQL statements.
        public let statements: [StatementData]

        public init(nextToken: String? = nil, statements: [StatementData]) {
            self.nextToken = nextToken
            self.statements = statements
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case statements = "Statements"
        }
    }

    public struct ListTablesRequest: AWSEncodableShape {
        /// The cluster identifier. This parameter is required when authenticating using either AWS Secrets Manager or temporary credentials.
        public let clusterIdentifier: String
        /// A database name. The connected database is specified when you connect with your authentication credentials.
        public let connectedDatabase: String?
        /// The name of the database that contains the tables to list. If ConnectedDatabase is not specified, this is also the database to connect to with your authentication credentials.
        public let database: String
        /// The database user name. This parameter is required when authenticating using temporary credentials.
        public let dbUser: String?
        /// The maximum number of tables to return in the response. If more tables exist than fit in one response, then NextToken is returned to page through the results.
        public let maxResults: Int?
        /// A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
        public let nextToken: String?
        /// A pattern to filter results by schema name. Within a schema pattern, "%" means match any substring of 0 or more characters and "_" means match any one character. Only schema name entries matching the search pattern are returned. If SchemaPattern is not specified, then all tables that match TablePattern are returned. If neither SchemaPattern or TablePattern are specified, then all tables are returned.
        public let schemaPattern: String?
        /// The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using AWS Secrets Manager.
        public let secretArn: String?
        /// A pattern to filter results by table name. Within a table pattern, "%" means match any substring of 0 or more characters and "_" means match any one character. Only table name entries matching the search pattern are returned. If TablePattern is not specified, then all tables that match SchemaPatternare returned. If neither SchemaPattern or TablePattern are specified, then all tables are returned.
        public let tablePattern: String?

        public init(clusterIdentifier: String, connectedDatabase: String? = nil, database: String, dbUser: String? = nil, maxResults: Int? = nil, nextToken: String? = nil, schemaPattern: String? = nil, secretArn: String? = nil, tablePattern: String? = nil) {
            self.clusterIdentifier = clusterIdentifier
            self.connectedDatabase = connectedDatabase
            self.database = database
            self.dbUser = dbUser
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.schemaPattern = schemaPattern
            self.secretArn = secretArn
            self.tablePattern = tablePattern
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case clusterIdentifier = "ClusterIdentifier"
            case connectedDatabase = "ConnectedDatabase"
            case database = "Database"
            case dbUser = "DbUser"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case schemaPattern = "SchemaPattern"
            case secretArn = "SecretArn"
            case tablePattern = "TablePattern"
        }
    }

    public struct ListTablesResponse: AWSDecodableShape {
        /// A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
        public let nextToken: String?
        /// The tables that match the request pattern.
        public let tables: [TableMember]?

        public init(nextToken: String? = nil, tables: [TableMember]? = nil) {
            self.nextToken = nextToken
            self.tables = tables
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case tables = "Tables"
        }
    }

    public struct StatementData: AWSDecodableShape {
        /// The date and time (UTC) the statement was created.
        public let createdAt: Date?
        /// The SQL statement identifier. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.
        public let id: String
        /// The SQL statement.
        public let queryString: String?
        /// The name or Amazon Resource Name (ARN) of the secret that enables access to the database.
        public let secretArn: String?
        /// The name of the SQL statement.
        public let statementName: String?
        /// The status of the SQL statement. An example is the that the SQL statement finished.
        public let status: StatusString?
        /// The date and time (UTC) that the statement metadata was last updated.
        public let updatedAt: Date?

        public init(createdAt: Date? = nil, id: String, queryString: String? = nil, secretArn: String? = nil, statementName: String? = nil, status: StatusString? = nil, updatedAt: Date? = nil) {
            self.createdAt = createdAt
            self.id = id
            self.queryString = queryString
            self.secretArn = secretArn
            self.statementName = statementName
            self.status = status
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case createdAt = "CreatedAt"
            case id = "Id"
            case queryString = "QueryString"
            case secretArn = "SecretArn"
            case statementName = "StatementName"
            case status = "Status"
            case updatedAt = "UpdatedAt"
        }
    }

    public struct TableMember: AWSDecodableShape {
        /// The name of the table.
        public let name: String?
        /// The schema containing the table.
        public let schema: String?
        /// The type of the table. Possible values include TABLE, VIEW, SYSTEM TABLE, GLOBAL TEMPORARY, LOCAL TEMPORARY, ALIAS, and SYNONYM.
        public let type: String?

        public init(name: String? = nil, schema: String? = nil, type: String? = nil) {
            self.name = name
            self.schema = schema
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case name
            case schema
            case type
        }
    }
}
